#include "Mymap.h"
#include "Myset.h"
#include <utility>

void Test1()
{
	int a[] = { 1,4,6,7,3,9,0,2,8 };
	Myset::set<int> s;
	for (auto e : a)
	{
		s.Insert(e);
	}
	for (auto& e : s)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;
}

void Test2()
{
	int a[] = { 1,4,6,7,3,9,0,2,8 };
	Mymap::map<int, int> m;
	for (auto e : a)
	{
		m.Insert(std::make_pair(e, e));
	}
	Mymap::map<int, int>::iterator it = m.begin();
	while (it != m.end())
	{
		std::cout << it->first << ":" << it->second << " ";
		++it;
	}
	std::cout << std::endl;
	it = m.end();
	while (it != m.begin())
	{
		--it;
		std::cout << it->first << ":" << it->second << " ";
	}
	std::cout << std::endl;
	it = m.end();
	while (it != m.begin())
	{
		--it;
		std::cout << it->first << ":" << m[it->first] << " ";
	}
	std::cout << std::endl;
	//Print(m);
}



int main()
{
	Test2();
	return 0;
}